function downloadAndUnZip() {
    function unzipProgressFun(progressEvent) {
        var progress = progressEvent.loaded / progressEvent.total * 100;
        document.getElementById("progress").innerHTML = "解压:"+progress+"%100";
    }

    function successFun(fileEntry) {
        console.log("download complete: " + fileEntry.toURL());
        window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function(dirEntry) {
            zip.unzip(fileEntry.toURL(), dirEntry.toURL()+"zip", function(isOk){
                if(isOk == -1) {
                    alert("解压失败");
                }
            },unzipProgressFun)
        });
    }

    function failFun(error) {
        console.log("An error has occurred: Code = " + error.code);
        console.log("upload error source " + error.source);
        console.log("upload error target " + error.target);
        alert('下载失败。');
    }

    function progressFun(progressEvent) {
        var progress = progressEvent.loaded / progressEvent.total * 100;
        document.getElementById("progress").innerHTML = "下载："+progress+"%100";
    }

    var uri = "https://www.chuzhitong.com/ceshi.zip";
    window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function(dirEntry) {
        var targetPath = dirEntry.toURL() + "ceshi.zip";
        var fileTransfer = new FileTransfer();
        fileTransfer.onprogress = progressFun;
        fileTransfer.download(
            uri,
            targetPath,
            successFun,
            failFun,
            false,
            {}
        );
    });
}